<?php
$rubrics = $this->items;
?>
<div class="content-box">

    <div class="content-box-header">
        <h3>News rubrics</h3>
        <ul class="content-box-tabs">
            <li><a class="default-tab" href="#tab1">Table</a></li>
        </ul>
        <div class="clear"></div>
    </div>
    <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
            <div class="row">
                <div class="span8">
                    <a href="/admin/rubrics/add" class="btn">Add</a>
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th>#</th>
                            <th>Name</th>
                            <th></th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach ($rubrics as $key => $rubric): ?>
                            <tr>
                                <td><?php echo $key + 1 ?></td>
                                <td><?php echo $rubric['name'] ?></td>
                                <td>
                                    <a class="btn" href="/admin/news/add/rubric/<?php echo $rubric['id'] ?>">
                                        Add article
                                    </a>
                                    <a class="btn btn-success" href="/admin/rubrics/edit/id/<?php echo $rubric['id'] ?>">
                                        Edit
                                    </a>
                                    <a class="btn btn-danger delete" href="/admin/rubrics/delete/id/<?php echo $rubric['id'] ?>">
                                        Delete
                                    </a>
                                </td>
                            </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>